
<?php
/** @var TareaController $this */
/** @var Tarea $model */
/** @var AweActiveForm $form */
Yii::app()->clientScript->scriptMap['jquery.js'] = false;
Util::tsRegisterAssetJs('_form_modal_llamada.js');
$form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
    'type' => 'horizontal',
    'id' => 'tarea-form',
    'enableAjaxValidation' => true,
    'action' => Yii::app()->createUrl('/tareas/tarea/ajaxCreteFromLlamada', array(
        'contacto_id' => $model->contacto_id,
        'entidad_tipo' => $model->entidad_tipo,
        'entidad_id' => $model->entidad_id
    )),
    'clientOptions' => array('validateOnSubmit' => false, 'validateOnChange' => FALSE,),
    'enableClientValidation' => false,
        ));
?>
<div class="modal-header">
    <a class="close" data-dismiss="modal">&times;</a>
    <h4><i class="icon-tasks"></i> Nueva Tarea</h4>
</div>
<div class="modal-body">
    <?php echo $form->hiddenField($model, 'nombre') ?>
    <div class="row-fluid" style="text-align: center">
        <h3><?php echo $model->nombre ?></h3>
    </div>
    <div class="space10"></div>
    <?php
    echo $form->datepickerRow($model, 'fecha_fin', array(
        'class' => 'span6',
        'options' => array(
            'startDate' => 'today',
            'language' => 'es',
            'format' => 'dd/mm/yyyy',
            'autoclose' => 'true',
            'weekStart' => 1,
            'keyboardNavigation' => true
        ),
    ));
    ?>
    <?php echo $form->timepickerRow($model, 'hora_fin', array('class' => 'span6', 'options' => array('showMeridian' => false, 'defaultTime' => false))); ?>
    <?php
    echo $form->dropDownListRow($model, 'etapa_id', CHtml::listData(TareaEtapa::model()->findAll(), 'id', TareaEtapa::representingColumn()), array('empty' => '- Seleccione -',
        'class' => 'span6 fix',
    ));
    ?>
    <?php echo $form->textFieldRow($model, 'porcentaje', array('class' => 'span4', 'readOnly' => 'True', 'id' => 'Prob', 'style' => "cursor: default")) ?> 
    <?php echo $form->textAreaRow($model, 'descripcion', array('rows' => 3, 'class' => 'span12')) ?>
    <?php echo $form->hiddenField($model, 'entidad_tipo') ?>
    <?php echo $form->hiddenField($model, 'entidad_id') ?>
    <?php echo $form->hiddenField($model, 'accion') ?>   
    <?php echo $form->hiddenField($model, 'contacto_id'); ?>   
    <?php echo $form->hiddenField($model, 'nombre') ?>



</div>
<div class="modal-footer">
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'type' => 'success',
        'icon' => 'ok',
        'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
        'htmlOptions' => array(
            'onClick' => 'js:ajaxCrearTarea("#tarea-form");')
    ));
    ?>
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'icon' => 'remove',
        'label' => Yii::t('AweCrud.app', 'Cancel'),
        'htmlOptions' => array('data-dismiss' => 'modal')
    ));
    ?>
</div>
<?php $this->endWidget(); ?>
